//
//  ShoppingCartViewController.m
//  GouWoAi
//
//  Created by 赵佟越 on 16/5/5.
//  Copyright © 2016年 zhaotongyue. All rights reserved.
//

#import "ShoppingCartViewController.h"
#import "Masonry.h"

@interface ShoppingCartViewController ()

@property (nonatomic, strong)UIImageView *imageViewCar;

@property (nonatomic, strong)UILabel *labelTip1;

@property (nonatomic, strong)UILabel *labelTip2;

@property (nonatomic, strong)UIButton *makeSureBtn;

@end

@implementation ShoppingCartViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self layoutNavigationBar];
    [self makeBaseUI];
    // Do any additional setup after loading the view.
}

- (void)viewWillAppear:(BOOL)animated{
    //    字体颜色
    self.navigationController.navigationBar.hidden = NO;
    self.navigationController.navigationBar.barStyle = UIBarStyleBlack;

}

-(void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];
    [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleDefault;
}

#pragma mark - Private Methods
- (void)layoutNavigationBar {
    self.navigationController.navigationBar.translucent = NO; 
    self.navigationController.navigationBar.barTintColor = [UIColor getColorFromRGBString:@"#F48000"];
    self.title = @"购物车";
    self.view.backgroundColor = [UIColor getColorFromRGBString:@"#F2F2F2"];
    
}

- (void)makeBaseUI{
    [self.view addSubview:self.imageViewCar];
    [self.view addSubview:self.labelTip1];
    [self.view addSubview:self.labelTip2];
    [self.view addSubview:self.makeSureBtn];
    
    [self.labelTip1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.imageViewCar.mas_bottom).offset(40);
        make.size.mas_equalTo(CGSizeMake(ZTY_SCREEN_WIDTH, 16));
    }];
    
    [self.labelTip2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.labelTip1.mas_bottom).offset(14);
        make.size.mas_equalTo(CGSizeMake(ZTY_SCREEN_WIDTH, 15));
    }];
    
    [self.makeSureBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.labelTip2.mas_bottom).offset(33);
        make.size.mas_equalTo(CGSizeMake(ZTY_SCREEN_WIDTH - 30, 92/2));
        make.left.equalTo(self.view).offset(15);
    }];
    
    
}


#pragma mark - LazyLoad

- (UIImageView *)imageViewCar{
    if (_imageViewCar == nil) {
        _imageViewCar = [[UIImageView alloc]initWithFrame:CGRectMake(196/2 *_ZTY_SCREEN_WIDTH, 50 * _ZTY_SCREEN_HEIGHT, 180 *_ZTY_SCREEN_WIDTH,  180 *_ZTY_SCREEN_WIDTH)];
        _imageViewCar.image = [UIImage imageNamed:@"sysicon_n_19@2x"];
    }
    return _imageViewCar;
}

- (UILabel *)labelTip1{
    if (_labelTip1 == nil) {
        _labelTip1 = [[UILabel alloc]init];
        _labelTip1.font = [UIFont systemFontOfSize:16];
        _labelTip1.text = @"购物车君饿着肚子在等您";
        _labelTip1.textAlignment = NSTextAlignmentCenter;
        
    }
    return _labelTip1;
}

- (UILabel *)labelTip2{
    if (_labelTip2 == nil) {
        _labelTip2 = [[UILabel alloc]init];
        _labelTip2.text = @"有种淡淡的忧伤";
        _labelTip2.textAlignment = NSTextAlignmentCenter;
        _labelTip2.font = [UIFont systemFontOfSize:15];
        _labelTip2.textColor = [UIColor getColorFromRGBString:@"909090"];
        
    }
    return _labelTip2;
}

- (UIButton *)makeSureBtn{
    if (_makeSureBtn == nil) {
        _makeSureBtn = [[UIButton alloc]init];
        _makeSureBtn.backgroundColor = [UIColor getColorFromRGBString:@"F48000"];
        _makeSureBtn.layer.cornerRadius = 5;
        [_makeSureBtn setTitle:@"朕去瞧瞧" forState:UIControlStateNormal];
        [_makeSureBtn addTarget:self action:@selector(makeSureBtnAction:) forControlEvents:UIControlEventTouchUpInside];
    }
    return _makeSureBtn;
}

#pragma mark - Button Action

- (void)makeSureBtnAction:(UIButton *)sender{
    // 去瞧瞧
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
